package domain;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;

public class TextFileReader {
	
	public static char[][] getMap(String file_path) {
		char[][] map = null;
		try {
			List<String> lines = Files.readAllLines(Paths.get(file_path), StandardCharsets.UTF_8);
			map = new char[lines.size()][];
			for(int i = 0; i < lines.size(); i++) {
				map[i] = lines.get(i).toCharArray();
			}
		} catch (IOException e) {
			System.err.println("Error opening file.");
		}	
		return map;
	}

}
